﻿using NUnit.Framework;

namespace ContosoUniversity.Domain.AppServices.Tests.CourseApplicationService
{
    [TestFixture]
    public class UpdateCourseTests
    {
        //public UpdateCourseRequest CreateValidRequest(params Action<UpdateCourseRequest>[] updates)
        //{
        //    var commandModel = new UpdateCourseCommandModel();
        //    var request = new UpdateCourseRequest("UserId", commandModel);
        //    updates.ToList().ForEach(func => func(request));
        //    return request;
        //}

        //[Test]
        //public void CheckInvariantValidation()
        //{
        //    Action<UpdateCourseRequest> CallSut = request =>
        //    {
        //        var serviceUnderTest = new ProductApplicationServiceFactory().Object;
        //        serviceUnderTest.UpdateCourse(request);
        //    };

        //    Assert2.CheckInvariants("Command cannot be null", () => CallSut(CreateValidRequest(p => p.CommandModel = null)));
        //    Assert2.CheckInvariants("ProductId must be > 0", () => CallSut(CreateValidRequest(p => p.CommandModel.ProductId = 0)));
        //    // Assert2.CheckInvariants("", () => CallSut(CreateValidRequest(p => p.CommandModel. )));
        //    // Assert2.CheckInvariants("", () => CallSut(CreateValidRequest(p => p.CommandModel. )));
        //}

        //[Test]
        //public void CheckValidationRules()
        //{
        //    Func<UpdateCourseRequest, ValidationDetails> CallSut = request =>
        //    {
        //        var serviceUnderTest = new ProductApplicationServiceFactory().Object;
        //        var reponse = serviceUnderTest.UpdateCourse(request);
        //        return reponse.ValidationDetails;
        //    };

        //           // Assert2.CheckValidation(
        //           //     "The effective date must not be before today",
        //           //     "EffectiveFrom",
        //           //     () => CallSut(CreateValidRequest(p => p.CommandModel.EffectiveFrom = DateTimeHelper.Today.AddDays(-1))));           }

        //[Test]
        //public void CheckUpdateCourseHappyPath()
        //{
        //}
    }
}
